package com.hjh.vip.demo.action;

import com.hjh.vip.demo.service.IQueryService;
import com.hjh.vip.spring.framework.v2.annotation.HjhAutowired;
import com.hjh.vip.spring.framework.v2.annotation.HjhController;
import com.hjh.vip.spring.framework.v2.annotation.HjhRequestMapping;
import com.hjh.vip.spring.framework.v2.annotation.HjhRequestParam;
import com.hjh.vip.spring.framework.v2.servlet.HjhModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * 公布接口url
 * @author Tom
 *
 */
@HjhController
@HjhRequestMapping("/")
public class PageAction {

    @HjhAutowired
    IQueryService queryService;

    @HjhRequestMapping("/first.html")
    public HjhModelAndView query(@HjhRequestParam("teacher") String teacher){
        String result = queryService.query(teacher);
        Map<String,Object> model = new HashMap<String,Object>();
        model.put("teacher", teacher);
        model.put("data", result);
        model.put("token", "123456");
        return new HjhModelAndView("first.html",model);
    }

}
